﻿namespace K9Nano.Domain.Organization;

public interface IOrganizationUnitManager
{
    Task CreateAsync(OrganizationUnit organizationUnit, CancellationToken cancellation);
    Task DeleteAsync(long id, CancellationToken cancellation);
    Task<List<OrganizationUnit>> FindChildrenAsync(long? parentId, bool recursive, CancellationToken cancellation);
    Task<OrganizationUnit?> GetAsync(long id, CancellationToken cancellation);
    Task<string> GetCodeAsync(long id, CancellationToken cancellation);
    Task<OrganizationUnit?> GetLastChildOrNullAsync(long? parentId, CancellationToken cancellation);
    Task<string> GetNextChildCodeAsync(long? parentId, CancellationToken cancellation);
    Task MoveAsync(long id, long? parentId, CancellationToken cancellation);
    Task<(int Total, OrganizationUnit[] Items)> QueryAsync(string? name, long? parentId, int pageIndex, int pageSize, CancellationToken cancellation);
    Task UpdateAsync(OrganizationUnit organizationUnit, CancellationToken cancellation);
}